home *** CD-ROM | disk | FTP | other *** search
- /* Write a demo message to All in board 1. */
-
- #include <iostream.h>
- #include <process.h>
-
- #include "msgbase.hpp"
-
- void main (void)
-
- {
- MsgBase Message ("D:\\TMP\\TMP");
-
- if (!Message.ErrorType)
- {
- // make a text body
-
- Message << "\001PID: WRTMSG 1.0\r";
- Message << "This is the first paragraph of this message.\n";
- Message << "Text will be added until a Hard Carriage Return";
- Message << "is encountered. I've added one to this line.\r";
- Message << "This is the second paragraph. As you can see the \\n, ";
- Message << "which was added above, has been ignored according ";
- Message << "to FSC-0001.\r";
-
- // initialize header
-
- Message.To ("All");
- Message.From ("Feico de Boer");
- Message.Subject ("Just a test");
- // Message.SetAttribute (0, MA_UNSENT | MA_PRIVATE | MA_LOCAL);
- Message.SetAttribute (MsgHdr::Unsent | MsgHdr::Private |
- MsgHdr::Local);
-
- // write message
-
- Message.Board (1);
- if (Message.Lock ("D:\\TMP\\TMP"))
- {
- cerr << "Error locking message base";
- exit (1);
- }
- if (Message.WriteNew ()) /* See how easy it is? */
- cerr << "Error writing message base: " << Message.ErrorType
- << ", " << Message.ErrorString << ".\n";
- Message.Unlock ();
- }
- else
- {
- cerr << "Error opening message base: " << Message.ErrorType << ", "
- << Message.ErrorString << ".\n";
- exit (1);
- }
- }
-